<form action"" method="get" class="form-horizontal" style="float: right;">
	<input class="span2" id="firstName" type="text" placeholder="First Name" name="firstName" value="<@s.property value="firstName" />" />
	<input class="span2" id="lastName" type="text" placeholder="Last Name" name="lastName" value="<@s.property value="lastName" />" />
	<button class="btn btn-primary"><i class="icon-search icon-white"></i> Search</button>
</form>
<table class="table table-bordered table-striped">
	<thead>
		<tr>
			<th>#</th>
			<th>Name</th>
			<th>Birthdate</th>
			<th>Address</th>
			<th>Action</th>
		</tr>
	</thead>
	<tbody>
		<#assign i = 1>
		<#list person.entityList as e>
		<tr title="${e.firstName!} ${e.middleName!} ${e.lastName!}">
			<td>${i}</td>
			<td>${e.firstName!} ${e.lastName!}</td>
			<td>${(e.birthdate?string("yyyy-MM-dd"))!}</td>
			<td>${e.address!}</td>
			<td>
				<a href="<@s.url namespace="/module/person" action="edit/${e.id}" />"><i class="icon-edit" title="Edit"></i></a>
				<a href="<@s.url namespace="/module/person" action="delete/${e.id}" />" class="delete"><i class="icon-fire" title="Delete"></i></a>
				<#--<a href="<@s.url namespace="/module/person" action="${e.id}" />"><i class="icon-eye-open" title="View Details"></i></a>-->
			</td>
		</tr>
		<#assign i = i + 1>
		</#list>
		<tr>
			<td colspan="5">
				<#--
				<div class="btn-group" style="float: left;">
				<a class="btn" href="?page=${person.currentPage - 1}"><i class=" icon-chevron-left"></i>&nbsp;</a>
				<span type="text" class="btn disabled">Page ${person.currentPage + 1} of ${person.totalPage}</span>
				<a class="btn" href="?page=${person.currentPage + 1}">&nbsp;<i class=" icon-chevron-right"></i></a>
				</div>
				-->
				<a class="btn" href="<@s.url namespace="/module/person" action="add" />" style="float: right;"><i class="icon-plus"></i> Add New</a>
			</td>
		</tr>
	</tbody>
</table>
	

<script type="text/javascript">
	$(function() {
		$('.delete').each(function() {
			$(this).click(function() {
				var anchor = $(this).attr('href');
				
				bootbox.confirm("Are you sure?", function(result) {
					if (result) {
						location.href = anchor;
					}
				});
				
				return false;
			});
		});
	});
</script>
